package top.huhuiyu.teachproject.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.huhuiyu.teachproject.base.BaseResult;
import top.huhuiyu.teachproject.entity.message.TbMessage;
import top.huhuiyu.teachproject.service.TbMessageService;
import top.huhuiyu.teachproject.validate.TbMessageValidate;

@RestController
@RequiredArgsConstructor
@RequestMapping("/message")
public class TbMessageController {
  private final TbMessageService tbMessageService;


  @PostMapping("")
  public BaseResult add(@Validated(TbMessageValidate.Add.class) @RequestBody TbMessage tbMessage) {
    return tbMessageService.add(tbMessage);
  }

}
